package com.hsb.service.impl;

import com.hsb.dao.BookDao;
import com.hsb.entity.Book;
import com.hsb.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDao bookDao;

    @Override
    public int insert(Book book) {
        return bookDao.insert(book);
    }

    @Override
    public int deleteById(int id) {
        return bookDao.deleteById(id);
    }

    @Override
    public Book queryById(int id) {
        return bookDao.queryById(id);
    }

    @Override
    public List<Book> queryAll() {
        return bookDao.queryAll();
    }

    @Override
    public int updateById(Book book) {
        return bookDao.updateById(book);
    }
}